package server;

import logic.Document;
import logic.Template;
import net.datagramme.DatarammeServer;

public class UdpServerRunner {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DatarammeServer server = new DatarammeServer(GlobalConfig.UDP_DOCUMENT_RETR_PORT,
				new RetrieverRemoteMethodExecutor(
				new ServerRetriever<Document>(GlobalConfig.DOCUMENT)));
		server.start();
		DatarammeServer server2 = new DatarammeServer(GlobalConfig.UDP_TEMPLATE_RETR_PORT,
				new RetrieverRemoteMethodExecutor(new ServerRetriever<Template>(GlobalConfig.TEMPLATE)));
		server2.start();
		DatarammeServer datarammeServer = new DatarammeServer(GlobalConfig.UDP_LOGON_PORT,
				new LogonRemoteMethodExecutor());
		datarammeServer.start();
		DatarammeServer datarammeServer2 = new DatarammeServer(GlobalConfig.UDP_LIST_PORT,
				new ListRemoteMethodExecutor());
		datarammeServer2.start();
		DatarammeServer datarammeServer3 = new DatarammeServer(GlobalConfig.UDP_REPORTER_PORT,
				new ReporterRemoteMethodExecutor());
		datarammeServer3.start();
		try {
			server.join();
			server2.join();
			datarammeServer.join();
			datarammeServer2.join();
			datarammeServer3.join();
		} catch (InterruptedException e) {

			e.printStackTrace();
		}
	}

}
